package com.leo.customer.entity.pojo

import com.leo.customer.entity.CreateTimeAndUpdateTime
import javax.persistence.*

@Entity
data class Product(
        var name: String = "",
        /**
         * 所属组织
         */
        @ManyToOne(targetEntity = Organize::class, cascade = [CascadeType.PERSIST, CascadeType.MERGE], fetch = FetchType.LAZY)
        @JoinColumn(name = "organize_id")
        var organize: Organize = Organize(),

        /**
         * 发布人
         */
        @ManyToOne(targetEntity = User::class, cascade = [CascadeType.PERSIST, CascadeType.MERGE], fetch = FetchType.LAZY)
        @JoinColumn(name = "publisher_id")
        var publisher: User = User(),
        /**
         * 纬度
         */
        var latitude:Long = 0L,
        /**
         * 经度
         */
        var longitude:Long = 0L,
        var address:String = ""

) : CreateTimeAndUpdateTime()
